﻿
using Caliburn.Micro;
namespace BankerenClient
{
    public class PlayGameViewModel : Screen, IMainScreen
    {
        #region Fields

        private PlayerViewModel[] players;
        private CardViewModel[] cards;

        private BindableCollection<ChatEntryViewModel> chatEntries;

        private CardViewModel trump;
        private BindableCollection<CardViewModel> hand;

        private int[] points;

        #endregion

        #region Properties

        #region Player Properties

        public PlayerViewModel[] Players
        {
            get { return this.players; }
            set
            {
                this.players = value;
                NotifyOfPropertyChange(() => Players);
                NotifyOfPropertyChange(() => PlayerOne);
                NotifyOfPropertyChange(() => PlayerTwo);
                NotifyOfPropertyChange(() => PlayerThree);
                NotifyOfPropertyChange(() => PlayerFour);
                NotifyOfPropertyChange(() => PlayerFive);
            }
        }

        public PlayerViewModel PlayerOne
        {
            get { return this.players[0]; }
        }

        public PlayerViewModel PlayerTwo
        {
            get { return this.players[1]; }
        }

        public PlayerViewModel PlayerThree
        {
            get { return this.players[2]; }
        }

        public PlayerViewModel PlayerFour
        {
            get { return this.players[3]; }
        }

        public PlayerViewModel PlayerFive
        {
            get { return this.players[4]; }
        }

        #endregion

        #region Card Properties

        public CardViewModel[] Cards
        {
            get { return this.cards; }
            set
            {
                this.cards = value;
                NotifyOfPropertyChange(() => Cards);
                NotifyOfPropertyChange(() => CardOne);
                NotifyOfPropertyChange(() => CardTwo);
                NotifyOfPropertyChange(() => CardThree);
                NotifyOfPropertyChange(() => CardFour);
                NotifyOfPropertyChange(() => CardFive);
            }
        }

        public CardViewModel CardOne
        {
            get { return this.cards[0]; }
        }

        public CardViewModel CardTwo
        {
            get { return this.cards[1]; }
        }

        public CardViewModel CardThree
        {
            get { return this.cards[2]; }
        }

        public CardViewModel CardFour
        {
            get { return this.cards[3]; }
        }

        public CardViewModel CardFive
        {
            get { return this.cards[4]; }
        }

        #endregion

        #region Point Properties

        public int[] Points
        {
            get { return this.points; }
            set
            {
                this.points = value;
                NotifyOfPropertyChange(() => Points);
                NotifyOfPropertyChange(() => PointOne);
                NotifyOfPropertyChange(() => PointTwo);
                NotifyOfPropertyChange(() => PointThree);
                NotifyOfPropertyChange(() => PointFour);
                NotifyOfPropertyChange(() => PointFive);
            }
        }

        public int PointOne
        {
            get { return this.points[0]; }
        }

        public int PointTwo
        {
            get { return this.points[1]; }
        }

        public int PointThree
        {
            get { return this.points[2]; }
        }

        public int PointFour
        {
            get { return this.points[3]; }
        }

        public int PointFive
        {
            get { return this.points[4]; }
        }

        #endregion

        public BindableCollection<ChatEntryViewModel> ChatEntries
        {
            get { return this.chatEntries; }
            set
            {
                this.chatEntries = value;
                NotifyOfPropertyChange(() => ChatEntries);
            }
        }

        public CardViewModel Trump
        {
            get { return this.trump; }
            set
            {
                this.trump = value;
                NotifyOfPropertyChange(() => Trump);
            }
        }

        public BindableCollection<CardViewModel> Hand
        {
            get { return this.hand; }
            set
            {
                this.hand = value;
                NotifyOfPropertyChange(() => Hand);
            }
        }

        #endregion
    }
}
